<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<ul>
				<li v-for="(item,idx) in list" v-on:click="show(idx)" key="item.id">
					<span>{{item.title}}</span>
					<ul v-if="item.show">
						<li v-for="val in item.msg" key="val">
							{{val}}
						</li>
					</ul>
				</li>
			</ul>
		</div>
	</body>
	<script src="../vue.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		let vm = new Vue({
			el:"#app",
			data:{
				list:[{
					id:"jhasgdjk21",
					title:"大菜",
					msg:["红烧肉","水煮肉片","狮子头"],
					show:false
				},{
					id:"sfsd14",
					title:"中菜",
					msg:["酸辣土豆丝","西红柿炒蛋"],
					show:false
				},{
					id:"56756asda",
					title:"凉菜",
					msg:["拍黄瓜","花生米"],
					show:false
				}]
			},
			methods:{
				show(i){
					this.list[i].show = !this.list[i].show
				}
			}
		})
	</script>
</html>
